package cn.dakaqi.dao;

import cn.dakaqi.entities.PlatformGroup;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

/**
 * Created by chunyang on 2016/6/5.
 */
public interface PlatformGroupDao extends PagingAndSortingRepository<PlatformGroup, Long>, JpaSpecificationExecutor<PlatformGroup>
{
    @Modifying
    @Query(nativeQuery = true,value = "DELETE FROM U_PLATFORM_GROUP WHERE GROUP_ID=:GROUP_ID AND PLATFORM_ID=:PLATFORM_ID")
    void delGroupAndPlat(@Param("GROUP_ID") long GROUP_ID, @Param("PLATFORM_ID") long PLATFORM_ID);
}

